changed an Rplus to an Rminus, added max principle check