Modified the algorithm to determine the state of a test.
Merged conflicts.