move border function to correct sum.stat