Assignment 2

These are the functions for assignment 2.