adding memory and runtime statistics to program2