role of a lawyer in court