Removed dead code and fixed comments