Japan's capital was moved from Nara to Kyoto in 794. New town was built on a site that fulfilled Chinese geometric requirements of localization: mountains surround it to the north, east, and west, two rivers, flowing north to south bounded it on east and west. Kyoto's streets were laid in a grid. To avoid a replay of the problem with growing power of temples, only two were allowed to stand within the city limits. All the other religious monuments had to be built outside.