changed bool_t to int