[FIX] fixed cost calculation and more changes