Change 3d data structure, merge with chris