Updated c script