Trying to figure out the optimal way of creating the autopiler