work from class

as well as for lab3 and 4