Your code does fill out both columns as far as I can see?
It also checks column A to find the next row to put data in. If column A is not filled out, it will overwrite the data.