the machines array moves around with realloc