interim commit, this code is crap it's going to take time to make sense of what all the variable actually should be labeled. I don't know if this code was intentionally obsfucated... or was just crap to begin with.