added time element, game flow, and optimizations