recursive paiting