Efficient LS, memory leaks plugged