Added comments on the functions