Move argument processing to separate function
Whitespace adjustment
Store global tables in variable so they only need to be processed once
Add documentation