added checking for bounds for Player class