Added comments on each function