Added cla to main implementation and other major changes