This looks like it replaces the previous value of out rather than appending to it.