Adds shuffle mode, log
adds writing tolog file
prepares data for clustering analysis