updated the functions