Move addition and division operations into java