Added console.logs to see what is happening to the data