Fixed gamelogic to pass tests