Added comments to explain what each of the functions do