Started to simplify the border drawing code - using clipping