An invention is a type of short composition in two-part counterpoint writing. This form emerged based on the contrapuntal improvisational style of some Italian musicians, such as Antonio Bonporti. Later, Johann Sebastian Bach wrote his 15 Inventions (BWV 772-786) as exercises for his son, Wilhelm Friedemann. This set of works was definitive of the invention as a musical form. Usually written for keyboard, inventions are similar to fugues, if much simpler. They consist of an exposition , followed by development and recapitulation. During the exposition, the subject and its answer are usually presented in the home key, while fugues use the dominant key for answers, making them more complex harmonically. Johann Sebastian Bach also wrote sets of three part inventions, which were called Sinfonias (though the term has somewhat fallen into disuse, as publishers use 'three part invention' to avoid creating confusion with Symphonies). Inventions are mostly used as keyboard and composition exercises, and rarely performed in public.