finds top and bottom of rows and right and left edges of characters
same as previous