after trying to fix n and n-1 boundary