some changes after feedback from @aelgru