Law and Order in Medieval Europe

How was it maintained? And what could a ctiminal expect?