Code cleanup: remove unused vars

also comment in cases where it looks like they could be useful