Added comments to all functions for clearness about their use