moved the c implementaions to a separate file