Improving the code
Added plotting script