removed lots of unused code and comments