Optimized speed by using bitwise operators making it exponentially faster