started to add some c functions