updating MainClass and Leaf