After using Amber as their capital for eight centuries, the Maharajas decided to build a city on the plain (Jaipuir) and to build a palace in the city. They were started in 1727. The palace is built round a series of garden courts, the Jai Nivas, with the Chandra Mahal looking out on a long garden with a central waterway. The city plan was based on a theoretically symmetrical grid (itself based on a vastu shastra mandala) but had to be adapted to fit the irregularities of the chosen site. A keen astronomer, Maharaja Jai Singh had a giant observatory built in the grounds of his palace. It is known as the Jantar Mantar and contains the world's largest sundial.