extraordinary fix: find_end implementation