Added comments and removed a testing function.