adding length window constants
fixing refactoring bug