merged with lab3 initial code