The boundary conditions have been added as "if" statements inside of the bin loop