Develop a musical piece using the given motif and adhere to the outlined structure.
X:1
L:1/8
M:4/4
K:G
['eg g2', 'agef g2 dg Bgdg |{a} geaf gedg'  
X:1
L:1/8
M:4/4
K:G
 EA (3.A.A.A A2 Bd | eg g2 egdc | BG G2 G3 E |{G} EDB,D GABG | EA (3.A.A.A A2 Bd | eg g2 egdg | 
 eg g2 dgbg |{a} gedB{d} BA A2 :| a2 ea{b} ageg | agbg agef | g2 dg Bgdg |{a} geaf gedg | 
 a2 ea{b} ageg | agbg ageg | dg g2 dgba | gedB{d} BA A2 :|  