As I mentioned earlier, this should be a boolean flag, rather than an integer variable