finalize density stuff