Removed unused code and commented