Added 3D files, reorganized code