optimise searching somehow