branch optimizations but bug with long long values