@dinhviethoa....
I did it! Your suggestion was really helpful. I like the code a lot better now. Unfortunately, the change got merged over here because I think I deleted this branch in hopes of creating a cleaner one...

https://github.com/rnirnber/spark/commit/9fa887d12cfa86776657ae00bad4c7047c76a704

I'll keep trying to get a cleaner branch for your to look at.