Add option for max number of bars