cleaned up unused vars and potentially unassigned vars