I'm having problems determining the productions for a CFG describing the language $L=\{ a^nb^m | n \le m+3 \}$
where $n,m \ge 0$
I'm very new to this so this example might be a little harder, but everything I try I end up not finding the correct solutions. Some example strings are $\epsilon$, $a$, $aa$, $aaa$, $b$, $ab$, $aab$, $aaab$, $aaaab$, $bb$, $abb$, $aabb$, $aaabb$, $aaaabb$, $aaaaabb$ etc.
This is how I tried reasoning:
since there can be a loop of $a$ in the beginning, I thought that one production could be
$A \rightarrow aAb | \epsilon$
But this is as far as my reasoning goes. What's confusing is that for each value of $m$, I have increasing $n$.
Can anyone give a hint, or give general hints how to construct CFG from languages?
Thanks!