Added comments to all the functions.