implemented before and after