Not sure why but this operation seems to return -1 when it's used a few lines later (145) and produces an error for creating an array with a negative size