Added LCM function