refactored Lua code
fixed typo
missing longitude
Merge pull request #1 from jnalley/refactor_lua

Refactored Lua code