functions for general game mechanics