added math helper
some changes