added error codes to error c,h
@mastergreg edge case handling for different values of W relative to group size