changed functionallity to use existing options