Added some comments and removed temporary testing functions from previous commit