implemented the Seach method.
misc clean up