Completed v1 of C ramp functions