Code that verifies result of problem 1