finished upgrade_detector.cs

upgrade detection now works properly