adding the prompt to return to the main fuction. fixing the loops