fix #4 first draft of the framework, calculates average