Code revision - Second Part

Some change, some function added