Completed code.

This should be the last major update. I added the cheat code
function(for those following this update), and made some twaks to other
areas.