added -x option and added support for a string in -s option