expanded game loop with alarm