need to debug conditionals for binary sort