Merge restrict function into master