fixed some undifined variable errors
issue #27, added list of valid group numbers
issue #27, added code to extract group and type number from $data[0]