Solution for lecture 2