Re-add top/bottom detect