Added pairing logic.