plotting works
added plotting legend stuff