Remove debug output & rewrite print to puts