logic fixes
plot title, and fix for legend positioning