improved lserv2.c