generalized and moved 2 procs to spreadsheeet