solution for test 2