add detailed commits for each function