I think there is a shortcut here. 

```
if (firstName) {
  name1 = true;
}
```

but even that can be made more effecient.