more border related stuff
scripted update of code from master at 54b1a08 more border related stuff