merge in max's changes