Added plotting functionality (not sure if it works yet)