added tests to test.c along with formatting of output