This is a little hard to read because : takes two different meanings in this line. Can you store the x value as a const int just to make it more readable?