modifications after Sylvain's feedback