want to put guard functions in but cant figure it out