Added the improvements as suggested by @ashutoshdhundhara .