rewrite pCleanupOOB to work correctly and more efficiently