realize all the functions