FIX: write density