Allowing SOME variation using tolerance variable. This implementation is different and interesting now.