private void checkCollision()
    {
        for (int z = aSnake.numberOfDots; z > 0; z--)
        {
        	if ((z > 4) && (aSnake.x[0] == aSnake.x[z]) && (aSnake.y[0] == aSnake.y[z])) isGameRunning = false;
        }

        if (aSnake.y[0] >= WINDOWHEIGHT) isGameRunning = false;
        if (aSnake.y[0] < 0) isGameRunning = false;
        if (aSnake.x[0] >= WINDOWWIDTH) isGameRunning = false;
        if (aSnake.x[0] < 0) isGameRunning = false;
        if(!isGameRunning) gameTimer.stop();
    }