# Compute context free grammars for twice the amount

$$\{ a^{k}b^{j} : k = 2j , k \geq 0\}$$

I'm trying to wrap my head around CFG's but I am having trouble. From this language, there should be twice as many a's than b's. Here is my attempt.

$$S \to aSb \ | \ a Sa \ | \ \epsilon$$

$$S \Rightarrow aSb \Rightarrow aaSbb \Rightarrow aaaSabb \Rightarrow aaaabb$$

But, I can also have this arise, which I don't want: $$S \Rightarrow aSb \Rightarrow aaSbb \Rightarrow aabb$$

How can I force the CFG to put twice as many a's as b's? Is there any general approach to solving these?

$(\epsilon, aab, aaaabb, aaaaaabbb, ...)$ and so on.
Here we notice that: a) The string always has to start with an $a$ and b) Every time we generate an $b$, there should be two $a$'s corresponding to it.
$$S \rightarrow \epsilon \ | \ aaSb$$