to invert bits a given pos