Ok, I feel like an idiot asking this, but what key is the main section (the parts with the bassline it starts and ends with) of Chameleon by herbie hancock in?

My best guess is Eb major, because then the bassline goes (starting on a G) 3,4,flat5,5,4,5, 6,flat7,7,1,6,8 and each phrase leads up to the 1 or the 5.
On the other hand, the second phrase doesn't sound like it resolves itself on the Db so my other guess is is Bb minor and the second phrase ends on the 3rd.

So what key is the main part of chameleon in, and is there anything wrong with my reasoning?
How may The National D help you waste your time?
i think its it Bb minor, or at least thats how my roommate in jazz camp this summer played it in, for his combo