Adding johnson's algorithm