Another attempt at fee calculation