Thanks, turns out I had the right code, I was just putting it in the wrong spot...