Dynamic objects code refactored. Added restart and end game.