some coarsen code