made plotting optional