Rewrite find-empty using map and keep indexed instead of for