corners state problem implemented, q5 passed