Added better legend support, density support