implements search, fixes #18