beginning to replace the first prints with logger statements