reimplementation stringcalculator