improved drawing method for patterns