add algorithm and lite main