add ability to specify a custom function for max-level validation

this is getting a bit silly