trying to fix partition when called with three elements