updated to correct function