player does not get caught on internal edges during collision detection.
some refactoring.