rename var -> variable
fix up style
remove discarded code