finishing up search and fixing some minor bugs