Imported code from the original branch.
Removed unneeded files.