implements sum() method for interger list