Replica tidy dataset step 1-4