bug fixes for plotting and input