Government's intervention question Given that demand for a good X is equal to $q_D=393-2p$ and market supply is $q_S=p/4-12$. Find equilibrium price and quantity, consumer and producer surplus and draw a diagram illustrating the situation. Given that:

a) $T=2q$, every single item sold is taxed.

b) $T=20\% TR$ total revenue is taxed

Obviously i have calculated the equilibrium price and quantity before taxation that is $p=180,q=33$.But i have no idea how to caculate those two values after taxation.
I apologise for the poor formatting and such, this is one of my first posts so please let me know if anything needs improvement (including, possibly, the correctness of my answer!).

For part a.), I'm assuming that a per unit tax of $2q$ is levied on the consumer in this market. The inverse demand function and inverse supply function are given by $p = \frac{393}{2} - \frac{q}{2}$ and $p = 4q + 48$ respectively. Thus, a per unit tax of $T = 2q$ will result in the inverse demand function being $p + 2q = \frac{393}{2} - \frac{q}{2} \iff p = \frac{393}{2} - \frac{5q}{2}$. Equating supply and demand, we find that the new equilibrium quantity is $q = 22.846$, the price that consumers pay is $185.077$ and the price producers receive is $139.385$.

For part b.), I'm assuming that a tax of $20$% of revenue is levied on the producer in this market. The inverse demand function and inverse supply function are given by $p = \frac{393}{2} - \frac{q}{2}$ and $p = 4q + 48$ respectively. Thus, a tax of $20$% of revenue will result in the inverse supply function being $p - 0.2p = 4q + 48 \iff p = 5q + 60$. Equating supply and demand, we find that the new equilibrium quantity is $q = 18.2$, the price that consumers pay is $187.4$ and the price producers receive is $120.8$.

I hope this makes sense (and is correct)! Feedback would be great!