wrote some functions and hsit