Problems A and B for week3