added (really) simple weighted average script/function