Main logic

Now it's working.
I had rewritten my code and let it run, but It was not working.  Probably, the ```line``` event is always recognized as string if it had inputted as number. So we have to use ```Number()``` function.