added plotting code: