[R] - Made search() a bit easier to read. Still not perfect.