first attempt at min rate. i imagine the instructions can be somewhat optimized.