retab and fix bits

- == to === etc
- wrap in function
More code fixes and noting unused code