debugged and working for test 1