Add implementation of euclidian algorithm.