Added pattern recognition for authentication