improved legend position