added progress & refined basic function