Added tests, fixed issues with solution for problem #2