add stream reading
add bit twiddling and ranges