Implement calculator for listener method.