Moving reading and writing formulae to Calculator.java