make return value nonzero on error
add another graph example