Wrote and tested partition methods.