cleaned up codensity