the c way of the agrithm