Adjusted int check algorithm