solved code of test