updating script to use existing function from candidate class