Importing from my cm kk branch. 2a PART.