Added tests for weighted average