add bellman algorithm