Fix sortNum - TODO: clear file at beginning if existing