small changes in 3a and including code for 2b