initial upgrade code working but need better tests