diff --git a/reading_machine/src/Transition.cpp b/reading_machine/src/Transition.cpp
index f32925c3fee73c1d786951fcd9a975114f02980b..bbf35cbc83ac8b238daf999051b12494c74e24e7 100644
--- a/reading_machine/src/Transition.cpp
+++ b/reading_machine/src/Transition.cpp
@@ -99,6 +99,23 @@ Transition::Transition(const std::string & name)
 
 void Transition::apply(Config & config, float entropy)
 {
+  if (config.hasColIndex("STACK_SIZE"))
+  {
+    auto & curValue = config.get("STACK_SIZE", config.getWordIndex(), 0);
+    if (curValue.get().empty())
+      curValue = fmt::format("{}", config.getStackSize());
+  }
+  if (config.hasColIndex("STACK_DIST"))
+  {
+    auto & curValue = config.get("STACK_DIST", config.getWordIndex(), 0);
+    if (curValue.get().empty())
+    {
+      if (config.hasStack(0) and config.hasStack(1))
+        curValue = fmt::format("{}", config.getStack(0) - config.getStack(1));
+      else
+        curValue = fmt::format("_");
+    }
+  }
   if (config.hasColIndex("ENTROPY"))
   {
     bool mean = true;