Updated learn & set pattern