added -o functionality