Modified for deprecated function.