Fixed byte datatype for bits[..], moved sum to local