punishing someone is for deterring him from repeating a mistake