Why `prev` is an unused variable? It's used after the line where it's declared.