I had left a print statement in, which alters the output. Removed it now.