Assignment 2, final version.