minor fixes to LT function. Still doesn't work correctly.