Refactored alpha/num pin sorting funcs