implement bellman-ford algorithm
refactor tests