Code formating and added some comments