Debug prints

AND some functional changes