Refactor

-Added more comments
-Removed some cruft