working for 4 samples