Fixes #2: now output can be redirected
Fixes #2: now output can be redirected