LI functions and socket Comm

Both need testing