By the Medieval period, clocks continued to use some of the older methods, such as sundials and water clocks, while also incorporating newer methods that included escapements. Other inventions by this time also included the hourglass, which was first known to have been used by the early Medieval period in the 8-9th centuries in Germany. The origins of the hourglass, however, could be much older. The key inventions were more sophisticated tower clocks that used more advanced water clocks and hydraulics, which would wind and use torque in mechanical component to tick at given intervals, such as every hour. Early examples include the Great Mosque in Damascus and the Mustansiriya school in Baghdad. One advance came in the early 13th century under Al-Jazari, who was an Islamic scholar who perhaps created one of the first fully automated clocks and even created a clock that would have programmable automata musicians that played for guests and could be reprogrammed. Some have described this as the earliest form of computer programming. Nevertheless, by the 13th century, mechanical clocks were becoming more common, although often still powered by water. Town squares throughout Europe were also putting up tower clocks as a way for townspeople to keep track of time and to be informed of important events such as time to prayers. Both in Christianity and Islam, time became an important element in prayers and religious activities, driving much research in improving clocks and making them more audible and visible as well. This is the case in Europe with bells being now attached to the mechanical devices of clocks so that sound could be used to inform on important time changes, often the change in the hour.