Royalty calculations

Draft 1