adding AddPattern method