moving head output to functions