Finished write-up and modified code (specifically plotting the output)