-correct some vars, refactoring
- optimize code