added -f option to test.sh