Update Lcm term

cleaned up code