private void removePoints(int id) throws SQLException
    {
        /*
         * Gets the number of group matches where the team id is playing or has played. 
         * The -1 is because the arraylist is not starting on 1 but 0, so 1 lower.
         */
        int matches = matchmgr.showCountTeamGroup(id) - 1;
        /*
         * The i in the for loop symbolises the place in the arraylist.
         */
        for (int i = 0; i <= matches; i++)
        {
            int guestTeamId = matchmgr.getGroupMatchesByTeamId(id).get(i).getGuestTeamId();
            int homeTeamId = matchmgr.getGroupMatchesByTeamId(id).get(i).getHomeTeamId();
            /*
             * Checking whether the selected match is played, if 1 continue
             */
            if (matchmgr.getGroupMatchesByTeamId(id).get(i).getIsPlayed() == 1)
            {
                /*
                 * Checks if the given team id is the same the hometeams id in the match.
                 */
                if (id == homeTeamId)
                {
                    /*
                     * Checks if the chosen team has lost or were tied
                     * if they lost, the winning team looses 3 points
                     * if tied the other team looses 1 point.
                     * if they wont we wont remove any points, since the team is getting deleted.
                     */
                    if (matchmgr.getGroupMatchesByTeamId(id).get(i).getHomeGoals() < matchmgr.getGroupMatchesByTeamId(id).get(i).getGuestGoals())
                    {
                        int currentPoints = teammgr.getById(guestTeamId).getPoints();
                        teammgr.setPoints(currentPoints - 3, teammgr.getById(guestTeamId));
                    }
                    else if (matchmgr.getGroupMatchesByTeamId(id).get(i).getHomeGoals() == matchmgr.getGroupMatchesByTeamId(id).get(i).getGuestGoals())
                    {
                        int currentPoints = teammgr.getById(guestTeamId).getPoints();
                        teammgr.setPoints(currentPoints - 1, teammgr.getById(guestTeamId));
                    }
                }
                /*
                 * Checks if the given team id is the same the guestteams id in the match.
                 */
                else if (id == guestTeamId)
                {
                    /*
                     * Checks if the chosen team has lost or were tied
                     * if they lost, the winning team looses 3 points
                     * if tied the other team looses 1 point.
                     * if they wont we wont remove any points, since the team is getting deleted.
                     */
                    if (matchmgr.getGroupMatchesByTeamId(id).get(i).getHomeGoals() > matchmgr.getGroupMatchesByTeamId(id).get(i).getGuestGoals())
                    {
                        int currentPoints = teammgr.getById(homeTeamId).getPoints();
                        teammgr.setPoints(currentPoints - 3, teammgr.getById(homeTeamId));
                    }
                    else if (matchmgr.getGroupMatchesByTeamId(id).get(i).getHomeGoals() == matchmgr.getGroupMatchesByTeamId(id).get(i).getGuestGoals())
                    {
                        int currentPoints = teammgr.getById(homeTeamId).getPoints();
                        teammgr.setPoints(currentPoints - 1, teammgr.getById(homeTeamId));
                    }
                }
            }
        }
    }