changes related to jordi's comments

Updates and code refinements based upon Jordi’s suggestions