How was law and punishment like in the middle ages