Changed a few variable names and added tolerance variable to tracking routine