fixed all issues.  should work now when starting from scratch and finds the max key now without a problem