Implemented first version of Bellman Ford algorithm