calculating CPU and memory used by adding up lines in top