adding memory and runtime statistics for program4