Redesigned search logic. Added LHS/Both direction searches. v2 candidate.