removing unused vars, and following conventions