Programming Assignment 3 implementation.