rewrite to use the functions that were already here
add example