Final code cleanup

Comments tweaked and unused code deleted.