Cleaning up the variables names and position code

This makes everything a bit simpler to understand.