adding base code for wavetraces and starting to fix replication