better comments, removing some unused code