tweak check_avemax and add comments
update check_avemax per #18

need to DRY and write more tests