changes to allow cell arrays for randomisation, needs testing!