Incorperated code for a friendly exit, need to find proper placement