added option to send output of egb to a file