Working versions of Assignment 2, problems 1 & 2