allocating the correct amount of space, making sure not to break execution early