Added mathhelpers and ironed out bugs