Reformatted
Delegate class extended
Fixed inverted logic