improved and fixed mild.sh