9 working algo