connectivity code introduced, other minor changes, ready for parameter search