Added constants.
Cleaned up "detectHit()"