Assignment 2 modifications completed

Modified the 2 stub functions forked from github and added the logic
needed for assignment 2