removing unused vars, fixing types