changed the calculation of violation score