Please feel free to play around with the source code and see if you can improve it. I'd be glad to merge your diff.