how to use patterns