Moved the structure part coordinate calculation into a separte function
Break vector functions out into util.lua