Added comments and deleted redundant functions
Fixed the merge conflict