When he was 29 he was encouraged to write an opera on the historical story of Boris Godunov. He based his opera on a play by Alexander Pushkin, but he also read history books by Nikolay Karamzin. He worked at the opera for a year while living with friends and working for the Forestry Department. In 1871 he had finished it, but it was not allowed to be performed in the theatre because it did not have an important part for a female. Mussorgsky changed the opera, adding a whole new act with a love scene with a Polish princess. He made other changes as well. The new version was accepted. The first performance of the complete opera took place in February 1874. Mussorgsky was then at the height of his fame.