use %n for newlines in printfs