Updated the functions