addressed review comments in PR 5 - switched to using stderr, removed garbage from previous attempts at error collection.