using periodic bdry condition