The implementation of the Programming Assignment 2 (first version)