Fixed bug in computeFutureCosts