This is all very good in theory... Needs testing!