updated toStructs to handle differing bit sizes for ints and floats.