Updated optimizations and added Dr. Margalit's cycle notation
Merge pull request #5 from MICC/f/any_distance

Updated optimizations and added Dr. Margalit's cycle notation