adds conditional endings class + tests