calculate rate and remaining