added option selection and output log