submission for assignement 2

completed code for functions required for assignment2