Correct implementatio of sign calculation