lab2 problem code