trying to make a funciton work