The primary function is to provide security and maintain order in the courtroom, thereby ensuring the protection of the court and the maintenance of those procedures surrounding the proper administration of justice.