Optimizing speed, going back to linear search