Using bit shift for faster calculation