Compose a piece following the given musical structure and incorporating the provided motif.
X:1
L:1/8
M:2/2
K:D
['ag fdec d2 AG', 'fdde fefg a2 fa bgaf g2 ag'  
X:1
L:1/8
M:2/2
K:D
 ag | fdec d2 AG | FGAB =cAGB | Adde fded | (3Bcd ef g2 ag | fdec d2 AG | FGAF =cAGB | Adde fdec |1 
 Addc d2 ag :|2 Addc d2 de |: fefg a2 fg | abag fdde | fefg a2 fa | bgaf g2 ag | fefg a3 f | 
 abag fdga | bgaf gfed | B/c/d ef g2 ag :|  