add dodgy retain algorithm