added c functions