updated old function to new equivalent