working on top line boundary detection - incomplete