Converted into a function.