V_2013_11_22

streamlined code, eliminated some single-use functions