Added comments to every function