Moved code to enable master checkbox to it's own function.