updated all the functions