Modified the Butterfly code. Added boundary condition case.