moved logic into game class