Revert
Fixed warnings,
Removed unused code.