finished assignment1 parts a and b