restructured model function for newly modified rates, rate_positions structures and for easier debugging