separated the vars by type

i hope i factored it correctly...