moving the impartance ratio calculation directly into the hook function.
moving the impartance ratio calculation directly into the hook function.