solved LCM
slight cleanup