total change to functionality
adding mathematical functions