align algorithm to C