Added sampling stuff.