Final commit

cleaned up the code a bit and added some text on the figures