Making Math tools in Java