before partition implementation