Added the funtions and comments to complete programming assignment 2.