Article above describes a very short implementation of the most efficient form of the algorithm (40 lines of code).