rewote mkL using State Monad style.