How do you collect and calculate royalties?