added sum() test and modified operate() test to test all operations