finished implementing calculator logic