Added comments and some cleanup. Closes #6