check_output: initial import (still WIP)