Changed bst.py and added sort