Changed so that premium and quantity are taken into account.