Fixed method that finds the bordering pieces to deal with edge cases.