Made the repetitive checkbox code into a function