Added Comments and code checked with PMD.