Magistrate and their functions