added options -m and -f