changed order of deletions
added avg load function