remove useless assertions
code refactoring
use [-1] insted of length method
code refactoring
remove tabs with spaces