First two parts of Assignment 1