implemented successor function in eightpuzzle