Adding comments, removing some dead code