Initial commit of new function and code for backwards compatibility.