small improvements to comments, remove unused var