Mathematical functions added. v2