finished second function, added comments on how to test both functions