implemented a sampling function
changed a parameter EPS