attempted to fix mathactivity further, should be more object oriented
merge