added general tollerance function removed pyc