simplify by moving out function to build ints out of byte sequences.