Renamed variables and added a few comments (for readibility purpose)