Updated function.