Added comments about the function working