http://scv.bu.edu/~aarondf/java/puzzle9.html