modified the test function in common.c, added selection sort