added option validation, required options and logging