refactor variables naming, code formating

Fix code formatting, variable names.
Didn't run it though..
Use gist https://gist.github.com to share piece of code instead initiate a repo :octocat: