fixed output to clear values before outputing