took sort functions out of header