remove print lines in random_partial function