Fixed printResults function