decodeDenseNodes logic is simplified