Added comments for some functions