Completed Assignment 2

Added in completed code containing two functions for assignment 2.