Shouldn't these three appends be before the IF block,as they exist in both branches or does their order matter?