for the sake of readability maybe save partitionedByIdx as int var first