add search function, limit left, and sort by limit