Getting both of my functions working