add strict mode and minor refactor/fix typos