implemented some upgrade stuff