implemented groups. Need to go in and refactor