updated calc script