Made it work for teacher

Got rid of memory leaks caused by the teachers main.