Adding math header and Scalar typedef