implement fast level set that only maintaining L_in and L_out