move lset functions to lset.c file