Updated the number of lead changes code