updated comments and removed dead code