made the density classifier more compact