added sampling stuff