removed unused vars,  updated selected fields