remove spurious square and fix midpoint finding (Naty)