Amended the function.