removed unused code that wasn't really a part of this library anyway
changed how the legend was organised slightly