fixed splitting heights into N groups