clean up main program
fixed scaling search error output