added flip_valid option to rules. also slipped in a $is_bolt check for future functionality