fix bugs in sen3d_main. and change data_globals such that it's adaptive in two machines.