feel a little foolish using Java as a calculator but this works