lecture 5 and problemset, solutions