more work on type
Update type to use newvalue methods and add wait and max_wait parameters