Fix code from teacher