Added a generic sequence generation function
Added a generic summing function