I wrote this algorithm to solve a problem for myself one night about 10 years ago (agree - not a very tough problem, but very useful if you don't have enough memory). I told a client about it and he tried to patent it! I never checked to see if it went through...