Added classes and functions with math functions