c6 example, algorithm rewrites