removed dead code, updated comments