cleaned up code now working smoothly with both loadavg and collectd