merged with lab2 skeleton code