same as last commit, but for the second function