better gathering of units, and added a unit mode