private void collisionCheck() {
        if ( (ballY <= 0)  ||  (ballY >= frameHeight - size - 22) ) 
            ballSpeedY *= -1;//reverses y direction when the ball hits the sides

        if (ballX < width) {
            if ((new Rectangle(p1x, (int) p1y, width, height).contains(new Point((int)ballX, (int) ballY + (size / 2) ))) )  
                ballBounce(1);
            else p2Score();
        }

        if (ballX > frameWidth - size - width) {
            if (new Rectangle(p2x, (int) p2y, width, height).contains(new Point((int) ballX + size, (int)ballY + (size / 2) )) )  
                ballBounce(2);
            else p1Score();
        }
    }