game functions implemented