Reworked cacheSample()
Refined the definition of beta.
Added config.h