some comments explaining the different functions