second iteration of debugging