Bach did not plan the Mass in B minor as one continuous work. Parts of it were composed in 1724. He put the movements together just before his death. It is one of the greatest musical works ever written.