- added support for average
- added tests for average