added clock functions to control game flow