add sort method: all tests passing