Working version of plotting