fix factor_L()
add test of factor_L