Added more calculations to make the legend easier to manuver by the manuser.