abstracted away search function