applying p boundary condition fixed