unused code removed
Addressed most compilation warnings