removed all errors reported by valgrind doring execution
also removed valgrind errors from loadavg code