repair problem in logging

Declare the puts-step function higher so it can be used in script setup