added <ctype.h> to get rid of the isspace() warning