basic logic to calculate investment costs