1.Removed name from code
2.Provided retry mechanism in case of connection failure
3.Removed filename from code
4.Added the comments on top of the function