Re-formulating the code for online 3D reconstruction