adds pattern class