added a c file with auxiliary functions