moved partition fn