succesfully reduced memory/time  usage of plotting