updated negative handling code, to be even better