Mostly Done, Some refactoring and minor fixes todo