finished C implementation, uncommented