moved some declarations around, improved readablity of what I have so far.