sum function and begin testing