Code that does the boundary projection and calculation