bug-fix

- remove unused code
- change location of variable initialization