removed unused patterns variable.