bug for negative numbers fixed