check for edge case in partitioning alg