Implemented a ton of stuff, and replaced magic numbers with symbolic
constants