Refactored code base.
Current version should now wok with 2.6/2.7 versions.