Removed distance computation in density