cleaned source code, added commentary
cleaned up source code