Hide and reveal checkbox options - Tidy up Jquery

So I am a relative novice to JS and the Jquery library. I have been playing around with something and can see it is extremely untidy, this is where I was hoping you guys could help suggest a better way of doing what I am trying to acheive.

Aim:

To have multiple checkboxes, some of which if selected reveal a sub set of checkboxes. If the parent is unchecked the children checkboxes should also become unchecked.