* : Added more comments and refactored for readability