now these functions are working