They were also responsible for other religious matters related to their astronomical expertise, such as the keeping of the Islamic calendar and the determination of the qibla (the direction to Mecca used for prayers).