removed mutable named variables (lists); style changes; added comments