comp.c final version!!!