Added NIL handling and normalized final score via the softmax function.