Move lookup tables above functions
Minor tweaks