Remove y1 and change condition to prevent exception

Replace y1 vaiable eith y.
Make chang in boundery condition for X.
Now we chech condition before we get color code.