added plot functions and polished
plotting function