added c version