Just changed Integer to int to keep the flag functions as they were.