Added notes, began modularizing, and cleaned up