You can simplify this method with "inject"! 
def sum(array)
		array.inject(0){|sum, x| sum +x}
	end