added searchAfter and searchBefore with some tests