added average filter
refactored some files
merge conflict