Implemented some functions in format.c and made a test file