working on math functionality