Fixing code and tweaking plots