massive re-structure of get_center and everything around it + fixed a bug in integ_mag