Debugged, but this approach seems hopeless