better (and worse code) quote table logic