Removed duplicate calc function