rewrote LC code