new reconstruct code