Rewrote code for groups to be more maintainable/readable and allow public and private groups