added control statement at end to terminate program and print out correct answer