implemented adding samples