Bring back code which determines discharge rate.
Add rate information; not tested thoroughly but looks fine so far