Forward-backward (alpha-beta) algorithm implemented