small update to the function