preliminary addition code; some other code adjustments