sql routines updated to set levels between 0-100