Added skeleton code for weighted majority