Cleared warnings, added extras  and cleaning leaked memory but not done yet