DRY-ed code, was able to recombine the two sorting functions into one with an if loop, now the sorting code can handle numbers and letters