modify violation and reward function