Removed some cruft and added some code documentation