Code used for my Part II Project