Added comments for all functions