changed follow mask implementation