solution for test 1