implemented plotting