Pattern recognition added