added a few play safety exceptions and reorder of main program.