rand
switching search algorithm
a
refactored algorithm. testing if it works now