Expanded code for profiling. Checking it in temporarily since I accidentally deleted it last time by not knowing all the git's weird corners.
Merged pull