Fix better calculation and output