Added comments for each function