changed bool to int for checks