start to add script for rate calculation