Added printf statements for debugging