Comments added

Added comments describing purpose of both functions.