refactored translation vector calculations into a seperate method