Changed variable name for readability

Changed the variable named "okid" to "usedid" so that the code would be less confusing.