Improvements in performance and methods.

The code needs a good organization and formatting. I did not commit this as it may be your personal taste.

The variables could be summarized in only one inline var.

I like to give preference to single quotes, but it is also personal taste.

If you want I can make those changes, thus encouraging me to contribute more to the project.

Hug.