template for max