Completed Assignment 2, with ample comments