Added comments for each function so far.