solving math problems using code