added -g option