Added DOC file and cleaned up code and removed unnecessary comments