pattern functionality