updated so that groups work