Changed onPreCalculate to return void