Added code comments, added unit tests along for the new codes