Made sequence reversing and LIKE lookup more general