Added lcm code