Worked out a 3-way partition version