Removed dead code, old comments, unused open statements