WIP: features detection, top/bottom detection