fix for value_of(X) error
clean up of code and docs