added more c functionality