added lib/lcm.c