test according to the teacher's solution