removes unnecessary variables