move prepare method to student section; call prepare in solve