figure 5-1
value is with type flag now