Final code

all the code has been formatted and is ready for submission.