moved some variables to where they made more sense