rearranged some code and added uniform-cost search