Porting coursework code