added a plot function and removed some verbose print statements