Homework for https://code.google.com/p/hpcource/