first commit, both functions seem to be working well