Added Comments to understand code better