Amending last commit

Just breaking the code into regions, there will be a lot here by the
end.