refactored calc
fixed string