removed hardcoded 'max'