Attention and pattern recognition