updated format and group checking (even more correct solution for #10)