This code above is a simple modification of that posted at http://list.cs.brown.edu/pipermail/plt-scheme/2004-December/007498.html by MatthiasFelleisen?. The entire thread is worth reading for a discussion of alternative implementations.
Parititions are discussed on many web pages. For instance: