Im only a beginner so i dont really understand most of what you have put there. I only need to know how to put in a quit function that i can activate anytime anywhere in my program.