Converted to for-else