completed solution for test.