q3: added debug statements to try find the bus error