moving stuff around and adding binary search