ugly player bounding code