adding documentation and plot4