modified partition to return count
sortCount works
comments