Completed comments and removed unused function