added plotting function, still needs work
added plotting function, still needs work