active set
removed comment
working sample with exit condition
clear state added, cleanup