How are the fees calculated?