Fixed signed-ness issue and removed unessecary operation