Testing optimized c code secsion. There is a bug. Left in lots of print statements in this version, but running on slower python algo.