fixed an issue with overzealous python shortening of code -_-;
adding changes to erikkson: getting optimal rates, tailored to inflow defn