Refactoring: missed an unbounded memory -1: now a constant