sort takes +- prefix for direction, minor bugs