Wrote Functions For Assignment 2