Main logic

Now it's working.
Why don't you use `this.result` instead of `result` ?