Using int instead of boolean for flag