added ansi-c version
added ansi-c version