Added comments

In order to make my code more clear I’ve added comments in the functions