cleanup code
add new prototype ret_maybe for tri-state variables type