updated to use new math package