added functions for coursera Programming Assignment 2