Changing from dev.copy() to png() device to solve some issues with plotting.
Minor adjustements to the plots. Added some comments.