I have no idea how to implement the automatic sample..