dumb max function and edits to dumb min