MS: Small auxiliary function added